{template header}
<script type="text/javascript" src="js/popWindow.js"></script>
<script type="text/javascript">
function check_oldpass(){
	var result=false;
	var oldpass=$('#oldpass').val();
	if( bytes(oldpass) <1|| bytes(oldpass)>32){
		$('#checkoldpass').html('{lang editPassTip1}').fadeIn();
		divDance('checkoldpass');
	}else{
		jQuery.ajax({
			url: "index.php?user-checkoldpass",
			cache: false,
			dataType: "xml",
			type:"post",
			async:false, 
			data: { oldpass: oldpass },
			success: function(xml){
				var	message=xml.lastChild.firstChild.nodeValue;
				if(message!='OK'){
					$('#checkoldpass').html(message).fadeIn();
					divDance('checkoldpass');
				}else{
					 $('#checkoldpass').html('OK');
					 result=true;
				}
			}
		});
	}
	return result;
}

function check_newpass(){
	var result=false;
	var newpass=$('#newpass').val();
	if( bytes(newpass) <1|| bytes(newpass)>32){
		$('#checknewpass').html('{lang editPassTip1}').fadeIn();
		divDance('checknewpass');
		return result;
	}
	if($('#oldpass').val()==newpass){
		$('#checknewpass').html('{lang editPassTip2}').fadeIn();
		divDance('checknewpass');
	}else{
		$('#checknewpass').html('OK').fadeIn();
		result=true;
	}
	return result;
}

function check_renewpass(){
	var result=false;
	var renewpass=$('#renewpass').val();
	if( bytes(renewpass) <1|| bytes(renewpass)>32){
		$('#checkrenewpass').html('{lang editPassTip1}').fadeIn();
		divDance('checkrenewpass');
		return result;
	}
	if($('#newpass').val()==renewpass){
		$('#checkrenewpass').html("OK");
		result=true;
	}else{
		$('#checkrenewpass').html('{lang editPassTip3}');
		divDance('checkrenewpass');
	}
	return result;
}

function docheck(){
	if(check_oldpass() && check_newpass() && check_renewpass()){
		return true;
	}else{
		return false;
	}
}
function expand(id){
	if(id=='usermanage'){
		$("ul#usermanage").toggle(); 
	}else{
		$('ul#userpms').toggle();
	}
}
</script>
 
<div class="wrap hd_map">
	<a href="{WIKI_URL}">{$setting['site_name']}</a> &gt; <a href="{url user-profile}">{lang selfManage}</a> &gt; {lang editPass}</div>
<section class="wrap clearfix">
<div class="r group1 bor-ccc gl_manage_main">
	<h2 class="col-h2">{lang editPass}</h2>
	<form name="profileform" action="{url user-editpass}" method="post" onsubmit="return docheck();">
		<ul class="col-ul">  
			<!--{if isset($message)}-->
			<li><dd id="editpass" style="color:#FF0000">$message</dd></li>
			<!--{/if}-->
			<li><span class="tl">{lang oldPass}:</span><input id="oldpass" name="oldpass" class="inp_txt" type="password" maxlength="32"/>&nbsp;<p id="checkoldpass"></p></li>
			<li><span class="tl">{lang newPass}:</span><input id="newpass" name="newpass" class="inp_txt" type="password" maxlength="32"/>&nbsp;<p id="checknewpass"> {lang editPassTip4}</p></li>
			<li><span class="tl">{lang renewPass}:</span><input id="renewpass" name="renewpass" class="inp_txt" type="password" maxlength="32"/>&nbsp;<p id="checkrenewpass">&nbsp;</p></li>
			<li>&nbsp;<input name="submit" type="submit" value="{lang submit}" class="btn_inp blue"/></li>
		</ul>
	</form>

</div>

<aside class="l group2">
<div class="sidebar bor-ccc gl_manage">
	<h2 class="col-h2 cblue"><span onclick="expand('usermanage');">{lang profile}</span></h2>	
	<ul id="usermanage">
		<li><a href="{url user-profile}" target="_self">{lang profile}</a></li>
		<li><a href="{url user-editprofile}" target="_self" >{lang editProfile}</a></li>
		<li class="on"><a href="{url user-editpass}" target="_self">{lang editPass}</a></li>
		<li><a href="{url user-editimage}" target="_self">{lang editImage}</a></li>
		<li><a href="{url doc-managesave}" target="_self">{lang manageSave}</a></li>
		<li><a href="{url user-invite}" target="_self">{lang regInvite}</a></li>
	</ul>
</div><div class="sidebar columns gl_manage">
	<h2 class="col-h2 cblue"><span onclick="expand('userpms');">{lang shortmessage}</span></h2>		
	<ul id="userpms">
		<li><a href="{url pms-box-inbox}" target="_self">{lang inbox}</a></li>
		<li><a href="{url pms-box-outbox}" target="_self" >{lang outbox}</a></li>
		<li><a href="{url pms-sendmessage}" target="_self" >{lang sendmessage}</a></li>
		<li><a href="{url pms-box-drafts}" target="_self">{lang draft}</a></li>
		<li><a href="{url pms-blacklist}" target="_self">{lang blacklist}</a></li>
	</ul>
</div>
</aside>
</section>
{template footer}